package com.tdkj.service.selfadvert.impl;

import java.util.LinkedHashMap;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tdkj.dao.selfadvert.IBeanSelfAdvertDao;
import com.tdkj.dao.website.IBeanComplaintDao;
import com.tdkj.model.base.BaseEntity;
import com.tdkj.model.selfadvert.BeanSelfAdvert;
import com.tdkj.service.BaseService;
import com.tdkj.service.selfadvert.IBeanSelfAdvertService;
@Component("beanSelfAdvertService")
public class BeanSelfAdvertImpl extends BaseService implements IBeanSelfAdvertService{
	private IBeanSelfAdvertDao beanSelfAdvertDao;

	public IBeanSelfAdvertDao getBeanSelfAdvertDao() {
		return beanSelfAdvertDao;
	}

	@Resource
	public void setBeanSelfAdvertDao(
			IBeanSelfAdvertDao beanSelfAdvertDao) {
		this.beanSelfAdvertDao = beanSelfAdvertDao;
	}

	@Override
	public BeanSelfAdvert setStatus(Long id) {
		BeanSelfAdvert bean=beanSelfAdvertDao.findById(id, BeanSelfAdvert.class);
		bean.setStatus("已审核");
		beanSelfAdvertDao.merge(bean);
		return null;
	}

	@Override
	public List<BeanSelfAdvert> findImgList() {
		BeanSelfAdvert bean=new BeanSelfAdvert();
		bean.setAdverttype("2");
		// TODO Auto-generated method stub
		return beanSelfAdvertDao.findByExample(bean);
	}

	@Override
	public List<BeanSelfAdvert> findTextList() {
		BeanSelfAdvert bean=new BeanSelfAdvert();
		bean.setAdverttype("1");
		// TODO Auto-generated method stub
		return beanSelfAdvertDao.findByExample(bean);
	}

}
